Optimal. Leaf size=448 \[ \frac {\left (c^6+6 i c^5 d-15 c^4 d^2-20 i c^3 d^3-105 c^2 d^4+150 i c d^5+55 d^6\right ) x}{8 a^3 (c-i d)^3 (c+i d)^6}-\frac {d^4 \left (15 c^2-18 i c d-7 d^2\right ) \log (c \cos (e+f x)+d \sin (e+f x))}{a^3 (c+i d)^6 (i c+d)^3 f}+\frac {d \left (c^3+6 i c^2 d-17 c d^2+28 i d^3\right )}{8 a^3 (c-i d) (c+i d)^4 f (c+d \tan (e+f x))^2}-\frac {1}{6 (i c-d) f (a+i a \tan (e+f x))^3 (c+d \tan (e+f x))^2}+\frac {3 i c-13 d}{24 a (c+i d)^2 f (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^2}+\frac {3 c^2+18 i c d-55 d^2}{24 (i c-d)^3 f \left (a^3+i a^3 \tan (e+f x)\right ) (c+d \tan (e+f x))^2}+\frac {d \left (c^4+6 i c^3 d-16 c^2 d^2+94 i c d^3+55 d^4\right )}{8 a^3 (c-i d)^2 (c+i d)^5 f (c+d \tan (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.83, antiderivative size = 448, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 5, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.179, Rules used = {3640, 3677,
3610, 3612, 3611} \begin {gather*} \frac {3 c^2+18 i c d-55 d^2}{24 f (-d+i c)^3 \left (a^3+i a^3 \tan (e+f x)\right ) (c+d \tan (e+f x))^2}-\frac {d^4 \left (15 c^2-18 i c d-7 d^2\right ) \log (c \cos (e+f x)+d \sin (e+f x))}{a^3 f (c+i d)^6 (d+i c)^3}+\frac {d \left (c^3+6 i c^2 d-17 c d^2+28 i d^3\right )}{8 a^3 f (c-i d) (c+i d)^4 (c+d \tan (e+f x))^2}+\frac {d \left (c^4+6 i c^3 d-16 c^2 d^2+94 i c d^3+55 d^4\right )}{8 a^3 f (c-i d)^2 (c+i d)^5 (c+d \tan (e+f x))}+\frac {x \left (c^6+6 i c^5 d-15 c^4 d^2-20 i c^3 d^3-105 c^2 d^4+150 i c d^5+55 d^6\right )}{8 a^3 (c-i d)^3 (c+i d)^6}+\frac {-13 d+3 i c}{24 a f (c+i d)^2 (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^2}-\frac {1}{6 f (-d+i c) (a+i a \tan (e+f x))^3 (c+d \tan (e+f x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3610
Rule 3611
Rule 3612
Rule 3640
Rule 3677
Rubi steps
\begin {align*} \int \frac {1}{(a+i a \tan (e+f x))^3 (c+d \tan (e+f x))^3} \, dx &=-\frac {1}{6 (i c-d) f (a+i a \tan (e+f x))^3 (c+d \tan (e+f x))^2}-\frac {\int \frac {-a (3 i c-8 d)-5 i a d \tan (e+f x)}{(a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^3} \, dx}{6 a^2 (i c-d)}\\ &=-\frac {1}{6 (i c-d) f (a+i a \tan (e+f x))^3 (c+d \tan (e+f x))^2}+\frac {3 i c-13 d}{24 a (c+i d)^2 f (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^2}-\frac {\int \frac {-2 a^2 \left (3 c^2+12 i c d-29 d^2\right )-4 a^2 (3 c+13 i d) d \tan (e+f x)}{(a+i a \tan (e+f x)) (c+d \tan (e+f x))^3} \, dx}{24 a^4 (c+i d)^2}\\ &=-\frac {1}{6 (i c-d) f (a+i a \tan (e+f x))^3 (c+d \tan (e+f x))^2}+\frac {3 i c-13 d}{24 a (c+i d)^2 f (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^2}+\frac {3 c^2+18 i c d-55 d^2}{24 (i c-d)^3 f \left (a^3+i a^3 \tan (e+f x)\right ) (c+d \tan (e+f x))^2}-\frac {\int \frac {6 a^3 \left (i c^3-6 c^2 d-21 i c d^2+56 d^3\right )+6 a^3 d \left (3 i c^2-18 c d-55 i d^2\right ) \tan (e+f x)}{(c+d \tan (e+f x))^3} \, dx}{48 a^6 (i c-d)^3}\\ &=\frac {d \left (c^3+6 i c^2 d-17 c d^2+28 i d^3\right )}{8 a^3 (c-i d) (c+i d)^4 f (c+d \tan (e+f x))^2}-\frac {1}{6 (i c-d) f (a+i a \tan (e+f x))^3 (c+d \tan (e+f x))^2}+\frac {3 i c-13 d}{24 a (c+i d)^2 f (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^2}+\frac {3 c^2+18 i c d-55 d^2}{24 (i c-d)^3 f \left (a^3+i a^3 \tan (e+f x)\right ) (c+d \tan (e+f x))^2}-\frac {\int \frac {-6 a^3 \left (6 c^3 d-i \left (c^4-18 c^2 d^2-38 i c d^3-55 d^4\right )\right )-12 a^3 d \left (6 c^2 d-i \left (c^3-17 c d^2+28 i d^3\right )\right ) \tan (e+f x)}{(c+d \tan (e+f x))^2} \, dx}{48 a^6 (i c-d)^3 \left (c^2+d^2\right )}\\ &=\frac {d \left (c^3+6 i c^2 d-17 c d^2+28 i d^3\right )}{8 a^3 (c-i d) (c+i d)^4 f (c+d \tan (e+f x))^2}-\frac {1}{6 (i c-d) f (a+i a \tan (e+f x))^3 (c+d \tan (e+f x))^2}+\frac {3 i c-13 d}{24 a (c+i d)^2 f (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^2}+\frac {3 c^2+18 i c d-55 d^2}{24 (i c-d)^3 f \left (a^3+i a^3 \tan (e+f x)\right ) (c+d \tan (e+f x))^2}+\frac {d \left (c^4+6 i c^3 d-16 c^2 d^2+94 i c d^3+55 d^4\right )}{8 a^3 (c-i d)^2 (c+i d)^5 f (c+d \tan (e+f x))}-\frac {\int \frac {6 a^3 \left (i c^5-6 c^4 d-16 i c^3 d^2+26 c^2 d^3-89 i c d^4-56 d^5\right )-6 a^3 d \left (6 c^3 d-i \left (c^4-16 c^2 d^2+94 i c d^3+55 d^4\right )\right ) \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{48 a^6 (i c-d)^3 \left (c^2+d^2\right )^2}\\ &=\frac {\left (c^6+6 i c^5 d-15 c^4 d^2-20 i c^3 d^3-105 c^2 d^4+150 i c d^5+55 d^6\right ) x}{8 a^3 (c-i d)^3 (c+i d)^6}+\frac {d \left (c^3+6 i c^2 d-17 c d^2+28 i d^3\right )}{8 a^3 (c-i d) (c+i d)^4 f (c+d \tan (e+f x))^2}-\frac {1}{6 (i c-d) f (a+i a \tan (e+f x))^3 (c+d \tan (e+f x))^2}+\frac {3 i c-13 d}{24 a (c+i d)^2 f (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^2}+\frac {3 c^2+18 i c d-55 d^2}{24 (i c-d)^3 f \left (a^3+i a^3 \tan (e+f x)\right ) (c+d \tan (e+f x))^2}+\frac {d \left (c^4+6 i c^3 d-16 c^2 d^2+94 i c d^3+55 d^4\right )}{8 a^3 (c-i d)^2 (c+i d)^5 f (c+d \tan (e+f x))}-\frac {\left (d^4 \left (15 c^2-18 i c d-7 d^2\right )\right ) \int \frac {d-c \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{a^3 (i c-d)^3 \left (c^2+d^2\right )^3}\\ &=\frac {\left (c^6+6 i c^5 d-15 c^4 d^2-20 i c^3 d^3-105 c^2 d^4+150 i c d^5+55 d^6\right ) x}{8 a^3 (c-i d)^3 (c+i d)^6}+\frac {d^4 \left (15 c^2-18 i c d-7 d^2\right ) \log (c \cos (e+f x)+d \sin (e+f x))}{a^3 (i c-d)^6 (i c+d)^3 f}+\frac {d \left (c^3+6 i c^2 d-17 c d^2+28 i d^3\right )}{8 a^3 (c-i d) (c+i d)^4 f (c+d \tan (e+f x))^2}-\frac {1}{6 (i c-d) f (a+i a \tan (e+f x))^3 (c+d \tan (e+f x))^2}+\frac {3 i c-13 d}{24 a (c+i d)^2 f (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^2}+\frac {3 c^2+18 i c d-55 d^2}{24 (i c-d)^3 f \left (a^3+i a^3 \tan (e+f x)\right ) (c+d \tan (e+f x))^2}+\frac {d \left (c^4+6 i c^3 d-16 c^2 d^2+94 i c d^3+55 d^4\right )}{8 a^3 (c-i d)^2 (c+i d)^5 f (c+d \tan (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(5726\) vs. \(2(448)=896\).
time = 8.53, size = 5726, normalized size = 12.78 \begin {gather*} \text {Result too large to show} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 1.69, size = 374, normalized size = 0.83 Too large to display
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 1151 vs. \(2 (398) = 796\).
time = 1.24, size = 1151, normalized size = 2.57 \begin {gather*} -\frac {2 \, c^{8} + 4 i \, c^{7} d + 4 \, c^{6} d^{2} + 12 i \, c^{5} d^{3} + 12 i \, c^{3} d^{5} - 4 \, c^{2} d^{6} + 4 i \, c d^{7} - 2 \, d^{8} - 12 \, {\left (i \, c^{8} - 4 \, c^{7} d - 4 i \, c^{6} d^{2} - 4 \, c^{5} d^{3} - 250 i \, c^{4} d^{4} - 764 \, c^{3} d^{5} + 924 i \, c^{2} d^{6} + 516 \, c d^{7} - 111 i \, d^{8}\right )} f x e^{\left (10 i \, f x + 10 i \, e\right )} + 6 \, {\left (3 \, c^{8} + 6 i \, c^{7} d + 18 \, c^{6} d^{2} + 66 i \, c^{5} d^{3} + 180 \, c^{4} d^{4} - 270 i \, c^{3} d^{5} + 62 \, c^{2} d^{6} - 330 i \, c d^{7} - 103 \, d^{8} - 4 \, {\left (i \, c^{8} - 6 \, c^{7} d - 14 i \, c^{6} d^{2} + 14 \, c^{5} d^{3} - 240 i \, c^{4} d^{4} - 274 \, c^{3} d^{5} - 114 i \, c^{2} d^{6} - 294 \, c d^{7} + 111 i \, d^{8}\right )} f x\right )} e^{\left (8 i \, f x + 8 i \, e\right )} + 3 \, {\left (15 \, c^{8} + 48 i \, c^{7} d + 24 \, c^{6} d^{2} + 312 i \, c^{5} d^{3} + 150 \, c^{4} d^{4} + 96 i \, c^{3} d^{5} + 864 \, c^{2} d^{6} + 216 i \, c d^{7} + 339 \, d^{8} - 4 \, {\left (i \, c^{8} - 8 \, c^{7} d - 28 i \, c^{6} d^{2} + 56 \, c^{5} d^{3} - 170 i \, c^{4} d^{4} + 136 \, c^{3} d^{5} - 252 i \, c^{2} d^{6} + 72 \, c d^{7} - 111 i \, d^{8}\right )} f x\right )} e^{\left (6 i \, f x + 6 i \, e\right )} + 2 \, {\left (19 \, c^{8} + 70 i \, c^{7} d - 34 \, c^{6} d^{2} + 210 i \, c^{5} d^{3} - 216 \, c^{4} d^{4} + 210 i \, c^{3} d^{5} - 254 \, c^{2} d^{6} + 70 i \, c d^{7} - 91 \, d^{8}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (13 \, c^{8} + 36 i \, c^{7} d + 16 \, c^{6} d^{2} + 108 i \, c^{5} d^{3} - 30 \, c^{4} d^{4} + 108 i \, c^{3} d^{5} - 56 \, c^{2} d^{6} + 36 i \, c d^{7} - 23 \, d^{8}\right )} e^{\left (2 i \, f x + 2 i \, e\right )} - 96 \, {\left ({\left (15 \, c^{4} d^{4} - 48 i \, c^{3} d^{5} - 58 \, c^{2} d^{6} + 32 i \, c d^{7} + 7 \, d^{8}\right )} e^{\left (10 i \, f x + 10 i \, e\right )} + 2 \, {\left (15 \, c^{4} d^{4} - 18 i \, c^{3} d^{5} + 8 \, c^{2} d^{6} - 18 i \, c d^{7} - 7 \, d^{8}\right )} e^{\left (8 i \, f x + 8 i \, e\right )} + {\left (15 \, c^{4} d^{4} + 12 i \, c^{3} d^{5} + 14 \, c^{2} d^{6} + 4 i \, c d^{7} + 7 \, d^{8}\right )} e^{\left (6 i \, f x + 6 i \, e\right )}\right )} \log \left (\frac {{\left (i \, c + d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + i \, c - d}{i \, c + d}\right )}{96 \, {\left ({\left (i \, a^{3} c^{11} - a^{3} c^{10} d + 5 i \, a^{3} c^{9} d^{2} - 5 \, a^{3} c^{8} d^{3} + 10 i \, a^{3} c^{7} d^{4} - 10 \, a^{3} c^{6} d^{5} + 10 i \, a^{3} c^{5} d^{6} - 10 \, a^{3} c^{4} d^{7} + 5 i \, a^{3} c^{3} d^{8} - 5 \, a^{3} c^{2} d^{9} + i \, a^{3} c d^{10} - a^{3} d^{11}\right )} f e^{\left (10 i \, f x + 10 i \, e\right )} + 2 \, {\left (i \, a^{3} c^{11} - 3 \, a^{3} c^{10} d + i \, a^{3} c^{9} d^{2} - 11 \, a^{3} c^{8} d^{3} - 6 i \, a^{3} c^{7} d^{4} - 14 \, a^{3} c^{6} d^{5} - 14 i \, a^{3} c^{5} d^{6} - 6 \, a^{3} c^{4} d^{7} - 11 i \, a^{3} c^{3} d^{8} + a^{3} c^{2} d^{9} - 3 i \, a^{3} c d^{10} + a^{3} d^{11}\right )} f e^{\left (8 i \, f x + 8 i \, e\right )} + {\left (i \, a^{3} c^{11} - 5 \, a^{3} c^{10} d - 7 i \, a^{3} c^{9} d^{2} - 5 \, a^{3} c^{8} d^{3} - 22 i \, a^{3} c^{7} d^{4} + 14 \, a^{3} c^{6} d^{5} - 14 i \, a^{3} c^{5} d^{6} + 22 \, a^{3} c^{4} d^{7} + 5 i \, a^{3} c^{3} d^{8} + 7 \, a^{3} c^{2} d^{9} + 5 i \, a^{3} c d^{10} - a^{3} d^{11}\right )} f e^{\left (6 i \, f x + 6 i \, e\right )}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 1.03, size = 782, normalized size = 1.75 \begin {gather*} -\frac {\frac {192 \, {\left (15 \, c^{2} d^{5} - 18 i \, c d^{6} - 7 \, d^{7}\right )} \log \left (d \tan \left (f x + e\right ) + c\right )}{-2 i \, a^{3} c^{9} d + 6 \, a^{3} c^{8} d^{2} + 16 \, a^{3} c^{6} d^{4} + 12 i \, a^{3} c^{5} d^{5} + 12 \, a^{3} c^{4} d^{6} + 16 i \, a^{3} c^{3} d^{7} + 6 i \, a^{3} c d^{9} - 2 \, a^{3} d^{10}} - \frac {6 \, {\left (-i \, c^{3} + 9 \, c^{2} d + 39 i \, c d^{2} - 111 \, d^{3}\right )} \log \left (i \, \tan \left (f x + e\right ) + 1\right )}{a^{3} c^{6} + 6 i \, a^{3} c^{5} d - 15 \, a^{3} c^{4} d^{2} - 20 i \, a^{3} c^{3} d^{3} + 15 \, a^{3} c^{2} d^{4} + 6 i \, a^{3} c d^{5} - a^{3} d^{6}} - \frac {6 i \, \log \left (-i \, \tan \left (f x + e\right ) + 1\right )}{a^{3} c^{3} - 3 i \, a^{3} c^{2} d - 3 \, a^{3} c d^{2} + i \, a^{3} d^{3}} - \frac {192 \, {\left (45 \, c^{2} d^{6} \tan \left (f x + e\right )^{2} - 54 i \, c d^{7} \tan \left (f x + e\right )^{2} - 21 \, d^{8} \tan \left (f x + e\right )^{2} + 100 \, c^{3} d^{5} \tan \left (f x + e\right ) - 114 i \, c^{2} d^{6} \tan \left (f x + e\right ) - 32 \, c d^{7} \tan \left (f x + e\right ) - 6 i \, d^{8} \tan \left (f x + e\right ) + 56 \, c^{4} d^{4} - 60 i \, c^{3} d^{5} - 9 \, c^{2} d^{6} - 6 i \, c d^{7} + d^{8}\right )}}{-4 \, {\left (i \, a^{3} c^{9} - 3 \, a^{3} c^{8} d - 8 \, a^{3} c^{6} d^{3} - 6 i \, a^{3} c^{5} d^{4} - 6 \, a^{3} c^{4} d^{5} - 8 i \, a^{3} c^{3} d^{6} - 3 i \, a^{3} c d^{8} + a^{3} d^{9}\right )} {\left (d \tan \left (f x + e\right ) + c\right )}^{2}} - \frac {11 i \, c^{3} \tan \left (f x + e\right )^{3} - 99 \, c^{2} d \tan \left (f x + e\right )^{3} - 429 i \, c d^{2} \tan \left (f x + e\right )^{3} + 1221 \, d^{3} \tan \left (f x + e\right )^{3} + 45 \, c^{3} \tan \left (f x + e\right )^{2} + 405 i \, c^{2} d \tan \left (f x + e\right )^{2} - 1755 \, c d^{2} \tan \left (f x + e\right )^{2} - 4035 i \, d^{3} \tan \left (f x + e\right )^{2} - 69 i \, c^{3} \tan \left (f x + e\right ) + 621 \, c^{2} d \tan \left (f x + e\right ) + 2403 i \, c d^{2} \tan \left (f x + e\right ) - 4491 \, d^{3} \tan \left (f x + e\right ) - 51 \, c^{3} - 363 i \, c^{2} d + 1125 \, c d^{2} + 1693 i \, d^{3}}{{\left (a^{3} c^{6} + 6 i \, a^{3} c^{5} d - 15 \, a^{3} c^{4} d^{2} - 20 i \, a^{3} c^{3} d^{3} + 15 \, a^{3} c^{2} d^{4} + 6 i \, a^{3} c d^{5} - a^{3} d^{6}\right )} {\left (\tan \left (f x + e\right ) - i\right )}^{3}}}{96 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 13.52, size = 2500, normalized size = 5.58 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________